<div class="tab-pane fade" id="reports" role="tabpanel" aria-labelledby="reports-tab">
  <div class="card shadow mb-4">
    <div class="card-header py-3 d-flex flex-row align-items-center justify-content-between">
      <h6 class="m-0 font-weight-bold text-primary">测试报告</h6>
      <a href="{% url 'test_report_list' %}?project_id={{ project.id }}" class="btn btn-sm btn-primary">
        <i class="fas fa-list fa-sm"></i> 查看所有
      </a>
    </div>
    <div class="card-body">
      {% if project_reports %}
        <div class="table-responsive">
          <table class="table table-bordered" width="100%" cellspacing="0">
            <thead>
              <tr>
                <th>名称</th>
                <th>类型</th>
                <th>格式</th>
                <th>创建时间</th>
                <th>操作</th>
              </tr>
            </thead>
            <tbody>
              {% for report in project_reports %}
                <tr>
                  <td>{{ report.name }}</td>
                  <td>{{ report.get_report_type_display }}</td>
                  <td>{{ report.get_report_format_display }}</td>
                  <td>{{ report.created_at|date:"Y-m-d H:i" }}</td>
                  <td>
                    <a href="{% url 'test_report_detail' report.id %}" class="btn btn-sm btn-info">
                      <i class="fas fa-eye"></i>
                    </a>
                    <a href="{% url 'test_report_delete' report.id %}" class="btn btn-sm btn-danger">
                      <i class="fas fa-trash"></i>
                    </a>
                  </td>
                </tr>
              {% endfor %}
            </tbody>
          </table>
        </div>
      {% else %}
        <div class="text-center py-4">
          <p class="text-muted">该项目暂无测试报告</p>
        </div>
      {% endif %}
    </div>
  </div>
</div>
